#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QCloseEvent>
#include<qfiledialog.h>
#include<to_mp4.h>
#include<QFile>
#include<QByteArray>
#include<qaction.h>
#include<fontandback.h>
#include<QDragEnterEvent>
#include<QDropEvent>
#include<QMimeData>
#include<QPlainTextEdit>
#include<QPaintEvent>
#include<qaction.h>
#include <QDesktopServices>
#include<QThread>
#include"wenjianshuju.h"
#include<QTimer>
#include<setweb.h>
#include<set_translation.h>
#include<mythr_translation.h>
#include<mynot_translation.h>
#include<mythr_createmp4.h>
#include<addyiping.h>
#include<addaudio_batches.h>
#include<translation_next.h>
#include<one_picture_video.h>
#include<video_stitching.h>
#include<subtitle_display_style.h>

//数据库
#include<QSqlDatabase>
#include<QMessageBox>
#include<QSqlError>
#include<QSqlQuery>
#include<QVariantList>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void showWangzhan();
    void title_tmepname();//生成视频准备
    bool DeleteFileOrFolder(const QString &strPath);
    void start_translation();//翻译线程
    void start_createmp4();//视频线程


private slots:
    void slotadd_txt_file();
    void slotsetoutfilename();
    void on_button_start_clicked();
    void on_Button_settitle_clicked();
    void slotnewchi(QString chi,double time);
    void slot_eng_filename();
    void slot_chi_filename();
    void slot_getsrt();
    void slot_next();
    void slot_timesleep();
    void slot_helpnext();
    void slot_setShowWeb(int num);
    //翻译
    void slot_trans_id(int id);
    void slot_helptrans();
    void slot_sarttimer();
    void slot_showproject(QString str,double line);
    //字幕展示风格
    void slot_Subtitle_style();

    //void signal_trans_next(QString **temp,int biaoshi,int maxline);
    void slot_trans_startnext();
    //增加音频
    void slot_addyinping_over();
signals:
    void signal_startthr_1();
    void signal_start_trans(int id,QString filename);
    //
    void signal_next();
    void signal_helpnext();
    void signal_nullpath();
    //添加音频



protected:

private:

    Ui::MainWindow *ui;
    QString path_txt_eglish;
    QString path_txt_chinese;
    QString outFilename;
    QString tempfilename;
    //数据库
    //QSqlQuery query;//不可以做成员,会报错
    QString title;
    //
    int yunxinshu;
    int next;
    double time_length;
    //菜单
    QAction getsrt;
    fontandback widget_font;
    //
    wenjianshuju wenjian;
    QTimer timer;
    //
    QString wangzhan;
    Setweb web;
    //翻译
    set_translation translation;
    int trans_id=1;
    QTimer timer_trans;
    //开启下部分
    int text_2=1;

    int maxline;
    QString **eng;
    int biaoshi;
    bool transisrun=0;

    //添加音频
    addyiping yinping;
    QString yinping_filename;
    //
    AddAudio_batches addyp_batches;
    //
    bool tomp4isrun=0;
    //一张图视频
    one_picture_video onepicture;
    //是否删除字幕文件
    bool delete_str=false;
    //视频拼接
    video_stitching video_stit;
    //字幕风格窗口
    Subtitle_display_style subtitle_style;
    bool ce_stop=false;


};
#endif // MAINWINDOW_H
